﻿<%@ Page Title="" Language="C#" MasterPageFile="~/AdminCP/MasterPage/Site1.Master" AutoEventWireup="true" CodeBehind="BranchesZoneManager.aspx.cs" Inherits="TARS.AdminCP.WebForm1" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <telerik:RadSkinManager ID="Metro" runat="server" Skin="Hay" />
    <telerik:RadFormDecorator ID="QsfFromDecorator" runat="server" DecoratedControls="All" EnableRoundedCorners="true" />
    <div>
        <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1" HorizontalAlign="NotSet">
            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            </telerik:RadAjaxManager>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:TARS_DeliveryConnectionString %>" DeleteCommand="DELETE FROM [t_BrachesZone] WHERE [ID] = @ID" InsertCommand="INSERT INTO [t_BrachesZone] ([ID], [ZoneName], [CreatedTime], [Active]) VALUES (@ID, @ZoneName, @CreatedTime, @Active)" SelectCommand="SELECT * FROM [t_BrachesZone] ORDER BY [CreatedTime] DESC" UpdateCommand="UPDATE [t_BrachesZone] SET [ZoneName] = @ZoneName, [CreatedTime] = @CreatedTime, [Active] = @Active WHERE [ID] = @ID">
                <DeleteParameters>
                    <asp:Parameter Name="ID" Type="Object" />
                </DeleteParameters>
                <InsertParameters>
                    <asp:Parameter Name="ID" Type="String" />
                    <asp:Parameter Name="ZoneName" Type="String" />
                    <asp:Parameter Name="CreatedTime" Type="DateTime" />
                    <asp:Parameter Name="Active" Type="Boolean" />
                </InsertParameters>
                <UpdateParameters>
                    <asp:Parameter Name="ZoneName" Type="String" />
                    <asp:Parameter Name="CreatedTime" Type="DateTime" />
                    <asp:Parameter Name="Active" Type="Boolean" />
                    <asp:Parameter Name="ID" Type="Object" />
                </UpdateParameters>
            </asp:SqlDataSource>
            <telerik:RadGrid ID="RadGrid1" runat="server" EnableLinqExpressions="false" AllowAutomaticInserts="false" AllowAutomaticUpdates="false" AllowFilteringByColumn="True"
                AllowPaging="True" AllowSorting="True" AutoGenerateEditColumn="True"
                CellSpacing="0" DataSourceID="SqlDataSource1" GridLines="None" OnItemCommand="RadGrid1_ItemCommand2" Skin="Hay" OnItemDataBound="RadGrid1_ItemDataBound"
                AutoGenerateColumns="False" OnInsertCommand="RadGrid1_InsertCommand" OnUpdateCommand="RadGrid1_UpdateCommand">
                <ClientSettings>
                    <Selecting AllowRowSelect="True" />
                    <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                </ClientSettings>
                <MasterTableView
                    AllowFilteringByColumn="true" AutoGenerateColumns="False" FilterExpression="([Active] = true)" CommandItemDisplay="TopAndBottom"
                    DataKeyNames="ID" DataSourceID="SqlDataSource1">
                    <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>

                    <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
                        <HeaderStyle Width="20px"></HeaderStyle>
                    </RowIndicatorColumn>

                    <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
                        <HeaderStyle Width="20px"></HeaderStyle>
                    </ExpandCollapseColumn>

                    <Columns>
                        <telerik:GridBoundColumn DataField="ID" FilterControlAltText="Filter ID column" Visible="false" HeaderText="ID" SortExpression="ID" UniqueName="ID" DataType="System.Guid" ReadOnly="True">
                            <ColumnValidationSettings>
                                <ModelErrorMessage Text="" />
                            </ColumnValidationSettings>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="ZoneName" FilterControlAltText="Filter ZoneName column" HeaderText="Zone's Name" SortExpression="ZoneName" UniqueName="ZoneName">
                            <ColumnValidationSettings>
                                <ModelErrorMessage Text="" />
                            </ColumnValidationSettings>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="CreatedTime" DataType="System.DateTime" FilterControlAltText="Filter CreatedTime column" HeaderText="Created Time" SortExpression="CreatedTime" UniqueName="CreatedTime" EditFormHeaderTextFormat="">
                            <ColumnValidationSettings>
                                <ModelErrorMessage Text="" />
                            </ColumnValidationSettings>
                        </telerik:GridBoundColumn>
                        <telerik:GridCheckBoxColumn DataField="Active" AllowSorting="true"
                            CurrentFilterFunction="EqualTo" CurrentFilterValue="True"
                            DataType="System.Boolean" FilterControlAltText="Filter Active column" HeaderText="Active" SortExpression="Active" UniqueName="Active" AndCurrentFilterFunction="EqualTo" AndCurrentFilterValue="True" AutoPostBackOnFilter="True">
                        </telerik:GridCheckBoxColumn>
                    </Columns>

                    <EditFormSettings>
                        <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
                    </EditFormSettings>

                    <EditItemStyle BackColor="LightGreen" />

                    <PagerStyle PageSizeControlType="RadComboBox" AlwaysVisible="True"></PagerStyle>
                </MasterTableView>

                <PagerStyle PageSizeControlType="RadComboBox" AlwaysVisible="True" Mode="NumericPages"></PagerStyle>

                <FilterMenu EnableImageSprites="False"></FilterMenu>
            </telerik:RadGrid>
            <br />
        </telerik:RadAjaxPanel>
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
        </telerik:RadWindowManager>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
        </telerik:RadAjaxLoadingPanel>
    </div>
</asp:Content>
